- /* scfdpowc.cpp by K.Tsuru */
- // function ID = 9105
- /********************************
- SComplex class
- It returns a^z = exp(z*log(a)).
-
- In the case a < 0,
- a = -(-a) = exp(i*pi)*(-a)
- log(a) = i*pi+log(-a)
- *********************************/
- #ifndef SN_H
- #include "sn.h"
- #endif
- SComplex Cpow(const SDouble& a, const SComplex& z){
- SComplex loga;
- // It allows a < 0.
- if(a.Sign() == 0) a.SetError(a.DOMAIN_ERR, "Cpow", 9105);// a == 0
- else if(z.IsZero(9105)) return 1.0; // z == 0
- else if(a.Sign() > 0) loga.Set( Log(a), 0.0 );
- else loga.Set( Log(-a), Pi() ); // = log(-a)+i*pi
-
- return Cexp(z*loga);
- }
scfdpowc.cpp : last modifiled at 2016/09/16 10:06:36(626 bytes)
created at 2017/10/06 15:21:28
The creation time of this html file is 2017/10/06 15:27:09 (Fri Oct 06 15:27:09 2017).